<?php



namespace App\Listeners\RechargeSuccessEvent;

use App\Businesses\BusinessState;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Services\Order\Services\OrderService;
use App\Services\Order\Interfaces\OrderServiceInterface;

class OrderPaidStatusChangeListener implements ShouldQueue
{
    use InteractsWithQueue;

    /**
     * @var OrderService
     */
    protected $orderService;


    public function __construct(OrderServiceInterface $orderService)
    {
        $this->orderService = $orderService;

    }

    public function handle($event)
    {
        // 修改订单状态为已完成
        $this->orderService->changePaid($event->order['id']);


    }
}
